package wbbs.web.admin;

import cn.webwheel.Action;
import cn.webwheel.results.TemplateResult;
import com.google.inject.Inject;
import wbbs.domain.BoardCategory;
import wbbs.service.BoardService;

import java.sql.SQLException;
import java.util.List;

public class categories extends BaseAction {

    List<BoardCategory> categories;

    @Inject
    BoardService boardService;

    @Action
    public Object html() throws SQLException {

        ensureLoginPage();

        categories = boardService.listCategories();
        return new TemplateResult(this);
    }

    public List<BoardCategory> getCategories() {
        return categories;
    }
}
